from get_data import *
import sys  
sys.path.append('code/data_capture')
from data_contrate import Data_consentrate
import time
import shutil  


def catdata():
    lst = ['open', 'high', 'low', 'close', 'volume', 'vol', 'lagret']
    for i in lst:
        D = Data_consentrate(root=r'data/stock_data/daily/price', thred=800)
        D.consentrate(key=i)

gz1000 = get_stock_codes(name='国证1000')['样本代码'].values
gz2000 = get_stock_codes(name='国证2000')['样本代码'].values
codes = np.union1d(gz1000, gz2000)
codes = codes
# t1 = time.time()
# shutil.rmtree(r'data/stock_data/daily/price')
# get_price(codes)
# catdata()
# t2 = time.time()
# codes = pd.read_pickle(r'data/stock_data/daily/consentrate_price/close.pkl.gzip').columns
get_market_value(codes)
# t3 = time.time()
# get_account(codes)
# t4 = time.time()
get_other_data()
# # t5 = time.time()
# # print(t2-t1)
# print(t3-t2)
# print(t4-t3)
# print(t5-t4)
